package month4.day19;


import java.util.HashSet;
import java.util.Set;

public class FirmSet {
        private String name;
        private String site;
        private String telephone;
        private String range;
        Set list=new HashSet();

        //输出员工信息
        public void show(){
            for(Object o:list){
                Staff staff=(Staff) o;
                staff.show();
            }
        }
        //辞退员工
        public boolean refuse(String number){
            Staff s=new Staff();
            s.setNumber(number);
            return list.remove(s);
        }
        //公司人数
        public int count(){
            return list.size();
        }
        //薪水最高的员工
        public Staff staff(){
            Staff sf=new Staff();
            sf.setMoney(0);
            if(list.isEmpty())
                return null;
            for(Object o:list){
                Staff staff=(Staff) o;
                if(staff.getMoney()>sf.getMoney())
                    sf=staff;
            }
            return sf;
        }

        public FirmSet(String name, String site, String telephone, String range) {
            this.name = name;
            this.site = site;
            this.telephone = telephone;
            this.range = range;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getSite() {
            return site;
        }

        public void setSite(String site) {
            this.site = site;
        }

        public String getTelephone() {
            return telephone;
        }

        public void setTelephone(String telephone) {
            this.telephone = telephone;
        }

        public String getRange() {
            return range;
        }

        public void setRange(String range) {
            this.range = range;
        }
}
